Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

1.12 Process Management

ps — Report Process Status Utility

Format:

ps [options]

Common Selection Options:

OptionArchitectural Meaning / Function
-eSelect all active processes.
-ASelect all active processes (identical to -e).
-aSelect all processes associated with a terminal, except session leaders.
-xSelect processes without controlling terminals.
-uSelect processes by effective user ID or name.

Output Format Control Options:

OptionArchitectural Meaning / Function
-fGenerate a full-format listing.
-lGenerate a long-format listing.
-oUser-defined format (specify custom output fields).

Examples:

$ ps -u root

$ ps -p 1234

$ ps -eo pid,ppid,cmd,%mem,%cpu

(Note: In the final example, pid, ppid, cmd, %mem, and %cpu are user-defined fields leveraged to explicitly identify the metrics represented in each output column).

top — Display Linux Tasks and Dynamic Process Monitor

Format:

top

Active process execution states are tracked using the flags R, S, D, and Z, defined as follows:

StateArchitectural Meaning
RRunning or Runnable (on execution queue)
SInterruptible Sleep (waiting for an event to complete)
DUninterruptible Sleep (usually waiting for hardware IO)
ZZombie (terminated but parent has not reaped exit status)

kill — Send a Signal to a Process

The most common use case is to terminate a target process execution sequence.

Format: kill [options] [signal] PID

Standard POSIX System Signals:

Signal NameNumeric VectorArchitectural Meaning / Default Action
SIGHUP1Controlling terminal hangup or configuration reload.
SIGINT2Keyboard interrupt signal (triggered via Ctrl+C).
SIGQUIT3Dump core and exit.
SIGKILL9Forceful termination kill signal (cannot be caught or ignored).
SIGTERM15Orderly termination signal (default signal sent by kill).
SIGCONT18Continue execution if currently stopped.
SIGSTOP19Stop process execution (cannot be caught or ignored).

Common Options:

OptionFunctional Specification
-lList all supported signal names.
-sSpecify the exact signal name to be sent. signal_name
-LList signal names alongside their corresponding numeric vectors.

Examples:

$ kill -l

$ kill -L

$ kill 1234

$ kill -9 1234

$ kill -SIGTERM 1234
Copyright © 2026 Guangzhou eSmart Information Technology Co., Ltd. All Rights Reserved.
All content in this book is copyrighted by the author. For personal learning and exchange only. Commercial use without authorization is strictly prohibited. Email:

✉ 3348194517@qq.com | hai616878@gmail.com